﻿using System;
using System.Diagnostics.Contracts;

namespace OpenWaves
{
    [ContractClass(typeof(ResolverContract))]
    public interface IResolver
    {
        bool TryResolve<T>(out T service) where T : class;
    }

    [ContractClassFor(typeof(IResolver))]
    public abstract class ResolverContract : IResolver
    {
        public bool TryResolve<T>(out T service) where T : class
        {
            Contract.Ensures(Contract.Result<bool>() == false || Contract.ValueAtReturn(out service) != null);

            throw new NotImplementedException();
        }
    }
}